<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3"><a id="head" ></a>区域管理</h1>
</div>
<div class="panel panel-default" ng-controller="sys_regionViewController">
    <div class="panel-body">
        <ng-form role="form" name="form" class="form-validation">
            <div class="panel panel-default">

                <div class="panel-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">上级区域名称</label>
                        <div class="col-sm-9">
                            <input type="text" ng-click="openTree()" class="form-control m-b-xs" placeholder="上级区域" ng-model="entity.parentId | sys_region_Fiter:'name'" >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">区域名称</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control  m-b-xs" placeholder="区域名称" ng-model="entity.name" required >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">区域代码</label>
                        <div class="col-sm-9">
                            <input type="text" name="code" class="form-control  m-b-xs" placeholder="区域代码" ng-model="entity.code" required ui-validate-async="{unique : 'unique($value)' }" >
                            <div class="bg-danger" ng-show="form.code.$invalid">
                                <div ng-show="form.code.$error.unique">区域代码已经存在，请重新输入。</div>
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">区域类型</label>
                        <div class="col-sm-9">
                            <select class="form-control m-b-xs" placeholder="区域类型" ng-model="entity.type" ng-init="entity.type = '1'"  required
                                    ng-options="row.value as row.label for row in dictionary.sysAreaType">
                            </select>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">顺序</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control  m-b-xs" placeholder="顺序" ng-model="entity.sort" required >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">备注</label>
                        <div class="col-sm-9">
                            <textarea type="text" class="form-control  m-b-xs" placeholder="备注" ng-model="entity.remarks"  />
                        </div>
                    </div>
                </div>
            </div>
            <footer class="panel-footer  lter">
                <!-- alert -->
                <div class="m-b-md">
                    <uib-alert ng-repeat="alert in Alert.alerts" type="{{alert.type}}" close="Alert.closeAlert($index)">{{alert.msg}}</uib-alert>
                </div>
                <!-- / alert -->
                <button type="submit" class="btn btn-success" ng-disabled="form.$invalid || saveBtnDisable" ng-click="save(); saveBtnDisable = true;">保存</button>
                <button type="submit" class="btn btn-success" ng-click="canle()">返回</button>
            </footer>
        </ng-form>
    </div>
</div>